At first, a conventional RAID apparatus will be explained. FIG. 5 shows a block diagram indicative of the configuration of one example of a conventional RAID apparatus and a host computer. As shown in FIG. 5, a RAID apparatus 6 is connected to a host computer 1 that gives instructions of writing and reading data. The RAID apparatus 6 includes CAs (Channel Adapter) 2A, 2B, CMs (Centralized Module) 3A, 3B, 3C, 3D, and DAs (Device Adapter) 4A, 4B, 4C, 4D, and disks 5A to 5L. One RAID apparatus has a plurality of CAs. One DA manages a plurality of discs. Hereinafter, the CA 2A, CM 3A, DA 4A, disc 5A will be explained.
The CA 2A is an interface for an external device such as the host computer 1. The CM 3A is a module that performs mainly I/O processing such as cache control by the host computer 1. The CM 3A includes a CM control unit 31A, a local cache 32A, and a mirror cache 33A. A local cache of a CM is a duplicate of a mirror cache of an adjacent CM, and caches of all the CMs are cyclically duplicated. For example, as shown in FIG. 5, the local cache 32A of the CM 3A is a duplicate of a mirror cache 33B of the adjacent CM 3B, while a local cache 32D of the CM 3D is a duplicate of the mirror cache 33A of the CM 3A. By cyclically duplicating caches, even though there is raised failure in one CM, data can be recovered using an adjacent CM.
The DA 4A is a module that controls accesses to the disks 5A, 5B, and 5C. The disk 5A retains data sent from the DA 4A.
Next, the operation of writing data in the conventional RAID apparatus will be explained referring to FIG. 5. Hereinafter, the case of writing data to the local cache 32A of the CM 3A and to the mirror cache 33B of the CM 3B will be explained. In this case, the disk 5A is the primary disk, while the disk 5D is the secondary disk. Disks are duplicated when writing back data on the local cache 32A, and thus duplicated disks are referred to as the primary disk and the secondary disk, respectively. Writing back is the processing of writing back contents data of a cache to a disk.
At first, the host computer 1 sends data to be written to the RAID apparatus 6 to the CA 2A. The CA 2A writes data sent from the host computer 1 to the local cache 32A of the CM 3A and to the mirror cache 33B of the CM 3B. When writing back contents data of the caches to the disks, the CM control unit 31A duplicates data on the local cache 32A to write back thus duplicated data to the primary disk 5A and to the secondary disk 5D.
When writing data to the local cache 32A of the CM 3A, the CA 2A adds a CC (Check Code) to input data to perform the writing operation. FIG. 6 shows a diagram indicative of one example of data having a CC added thereto. The CC (8 Bytes) is composed of two pieces of information or a Block ID and a code for check, and is added every 1 Block (512 Bytes) data. The Block ID is the logical position and attribution information of data. The code for check is an error detection code to check the validity of data by employing the CRC (Cyclic Redundancy Check). The code for check is a remainder that is obtained by seeing data as one multinomial and dividing the multinomial by a generator multinomial. Employing the CRC, error of data can be detected by comparing a remainder calculated from the data with a remainder actually added to the data.
Next, the operation of reading out data in the conventional RAID apparatus will be explained referring to FIG. 7. FIG. 7 shows a flow chart for explaining the operation of reading out data in the conventional RAID apparatus. Hereinafter, the case of reading out data from the local cache 32A of the CM 3A after the writing operation illustrated using FIG. 5 will be explained.
Firstly, when the host computer 1 gives an instruction of reading-out request to the CA 2A, the CA 2A notifies the CM control unit 31A of the reading-out request (S1).
Next, the CM control unit 31A judges whether cache miss is raised or not (S2). The cache miss indicates that data specified by reading-out request does not exist in a cache, while cache hit indicates that data specified by reading-out request exists in a cache.
In the case of cache hit (S2, No), the CA 2A reads out data from the local cache 32A, and checks the validity of thus read out data using a CC (S3). In case the data on the local cache 32A is valid (S3, Yes), the CA 2A notifies the CM control unit 31A that the data is valid, and the CM control unit 31A transfers the data on the local cache 32A to the host computer 1 (S4), ending the processing. On the other hand, in case the data on the local cache 32A is invalid (S3, No), the CA 2A notifies the CM control unit 31A that the data is invalid, and the CM control unit 31A makes a response of abnormal termination to the host computer 1 (S5), ending the processing.
In the case of cache miss (S2, Yes), the CM control unit 31A requests the DA 4A to expand data of the primary disk 5A onto the local cache 32A. Next, the DA 4A reads out data from the primary disk 5A to expand thus read out data onto the local cache 32A (S6).
Next, the CA 2A reads out data from the local cache 32A, and checks the validity of thus read out data using a CC (S7). In case the data read out from the primary disk 5A is valid (S7, Yes), the CA 2A notifies the CM control unit 31A that the data is valid, and the CM control unit 31A transfers the data on the local cache 32A to the host computer 1 (S8), ending the processing. On the other hand, in case the data read out from the primary disk 5A is invalid (S7, No), the CA 2A notifies the CM control unit 31A that the data is invalid, and the CM control unit 31A requests the DA 4B to expand data of the secondary disk 5D onto the local cache 32A. Next, the DA 4B reads out data from the secondary disk 5D to expand thus read out data onto the local cache 32A (S9).
Next, the CA 2A reads out data from the local cache 32A, and checks the validity of thus read out data using a CC (S10). In case the data read out from the secondary disk 5D is valid (S10, Yes), the CA 2A notifies the CM control unit 31A that the data is valid, and the CM control unit 31A transfers the data on the local cache 32A to the host computer 1 (S11), ending the processing. On the other hand, in case the data read out from the secondary disk 5D is invalid (S10, No), the CA 2A notifies the CM control unit 31A that the data is invalid, and the CM control unit 31A makes a response of abnormal termination to the host computer 1 (S12), ending the processing.
Concerning other conventional techniques, as a peripheral storage control device for duplicated disks, there is known a peripheral storage control device that includes a buffer memory for transiently storing data sent from outside and a control unit, corresponding to the duplicated disks respectively. This peripheral storage control device writes date sent from outside to two buffer memories, and writes the data of the two buffer memories to different disks, respectively (For example, refer to Patent Document 1: Jpn. Pat. Appln. Laid-Open Publication No. 56-127262 (page 3 to page 5, FIGS. 1 and 2)).
However, even though above-described RAID apparatus 6 has a plurality of local caches and mirror caches which are cyclically duplicated, data of mirror caches is not used at the time of ordinary writing back processing. Accordingly, even if writing data to mirror caches is successfully performed, in case writing data to local caches is not successfully performed, there is raised a problem that invalid data is written to both the primary disk and the secondary disk. Furthermore, at the time of reading out data from caches, data of a mirror cache of an adjacent CM is not used so long as there is raised no failure in a CM having a local cache. That is, in a RAID apparatus having a plurality of disks and a plurality of caches with its paths for reading and writing data complicatedly formed, there may be raised a problem that data cannot be recovered depending on paths.
The present invention has an object to overcome the above-mentioned drawbacks by providing a RAID apparatus, a RAID Control Method, and a RAID Control Program that assure safety on any path at the time of writing and reading data.